class Solution {
public:
    vector<vector<int>> ret;
    vector<int> path;
    void dfs(int n, int k, int pos)
    {
        if (path.size() == k)
        {
            ret.push_back(path);
            return;
        }
        if (pos == n + 1)
        {
            return;
        }
        path.push_back(pos);
        dfs(n, k, pos + 1);
        path.pop_back();
        dfs(n, k, pos + 1);
    }
    vector<vector<int>> combine(int n, int k) {
        dfs(n, k, 1);

        return ret;
    }
};